package com.czk.gateway.exclusivegateway;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;

/**
 * 加入排他网关
 * 当多个条件都成立的时候选择一个，可打开bpm的xml文件，默认走id小的那条路线
 * @Author ChenZhangKun
 * @Date 2020/9/15 16:13
 */
public class Deployment {
    public static void main(String[] args) {
        // 获取流程引擎
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        // 获取部署任务
        RepositoryService repositoryService = processEngine.getRepositoryService();
        // 部署bpm
        org.activiti.engine.repository.Deployment deployment = repositoryService.createDeployment()
                .addClasspathResource("diagram/agile.bpmn")
                .addClasspathResource("diagram/agiled.png")
                .name("组任务的请假流程")
                .deploy();
        // 输出部署信息
        System.out.println("部署名称 "+deployment.getName());
        System.out.println("部署id "+deployment.getId());
    }
}
